# 类型转换 str() int() float()
name = 'xxxx'
age = 20

print(type(name), type(age))
print('my name is ' + name + ', and age is ' + str(age))

print("str() 转成字符串")
a = 10
b = 10.99
c = False
print(type(a), type(b), type(c))
print(str(a), str(b), str(c))
print(type(str(c)))

print('int() 将数值字符串或是布尔值转成整型')
s1 = '127'
f1 = -98.7
s2 = '76.77'
ff = True
s3 = 'hello'
print(type(s1), int(s1))
print(type(f1), int(f1))
print(type(ff), int(ff))

print('float() 将 数字字符串 boolean 整数转换成浮点数')
s1 = '22.22'
s2 = '90'
ff = True
i = 90
s3 = 'xxx'

print(type(s1), float(s1))
print(type(s2), float(s2))
print(type(ff), float(ff))
print(type(i), float(i))


